package com.seawaterbt.ssm.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seawaterbt.ssm.config.DataSource;
import com.seawaterbt.ssm.config.DataSourceEnum;
import com.seawaterbt.ssm.entity.CzBasHeatstation;
import com.seawaterbt.ssm.mapper.CzBasHeatstationMapper;
import com.seawaterbt.ssm.service.CzBasHeatstationService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CzBasHeatstationServiceImpl extends ServiceImpl<CzBasHeatstationMapper, CzBasHeatstation> implements CzBasHeatstationService {

    @DataSource(DataSourceEnum.DB2)
    @Override
    public List<CzBasHeatstation> getByCodeGetTime(QueryWrapper wrapper) {
        return this.list(wrapper);
    }

    @DataSource(DataSourceEnum.DB2)
    @Override
    public CzBasHeatstation listOne(String code) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("code",code);
        return this.getOne(wrapper);
    }
    @DataSource(DataSourceEnum.DB2)
    @Override
    public CzBasHeatstation GetOneByProviencecode(String provinceCode) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("code_province",provinceCode);
        return this.getOne(wrapper);
    }

    @DataSource(DataSourceEnum.DB2)
    @Override
    public List<CzBasHeatstation> list(Wrapper<CzBasHeatstation> queryWrapper) {
        return super.list(queryWrapper);
    }
    @DataSource(DataSourceEnum.DB2)
    @Override
    public CzBasHeatstation getOne(Wrapper<CzBasHeatstation> queryWrapper) {
        return super.getOne(queryWrapper);
    }
}
